Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use automatic port for UDP send #11

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

nastevens
Copy link
Contributor

Use an automatically-assigned free UDP port in the ephemeral port range for sending by default. Since none of the DataDog metrics require two-way communication, the assigned port number does not need to be remembered/exposed.

This avoids port conflicts if more than one Client is being used at the same time from different threads.

@nastevens nastevens mentioned this pull request Apr 10, 2017
@@ -17,8 +17,8 @@ Build an options struct and create a client:
```rust
use dogstatsd::{Client, Options};

// Binds to a udp socket on 127.0.0.1:8126 for transmitting, and sends to
// 127.0.0.1:8125, the default dogstatsd address.
// Binds to a udp socket on an available ephemeral port on 127.0.0.1 for
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this might have gotten a tad messed up, we're sending to 127.0.0.1:8125, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, you're absolutely right. I fixed this up and pushed a new commit.

Use an automatically-assigned free UDP port in the ephemeral port range
for sending by default. Since none of the DataDog metrics require
two-way communication, the assigned port number does not need to be
remembered/exposed.

Signed-off-by: Nick Stevens <nick@bitcurry.com>
@nastevens nastevens force-pushed the use-automatic-udp-port branch from b943545 to 95fb0ad Compare April 12, 2017 12:38
@mcasper mcasper merged commit 7c8f429 into mcasper:master Apr 12, 2017
@nastevens nastevens deleted the use-automatic-udp-port branch April 26, 2017 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants